//
//  YXReleaseContentView.m
//  CreditCard
//
//  Created by 杨旭 on 2017/12/27.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "YXReleaseContentView.h"
@interface YXReleaseContentView ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UILabel *textLab;
@property (weak, nonatomic) IBOutlet UITextView *textView;

@end

@implementation YXReleaseContentView

-(instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        // 从xib中找到我们定义的view
        NSArray *viewArray = [[NSBundle mainBundle]loadNibNamed:@"YXReleaseContentView" owner:self options:nil];
        self = viewArray[0];
        self.frame = frame;
        self.backgroundColor = color_backColor;
        self.textView.delegate = self;
    
        _imgPicker = [[LLImagePickerView alloc]initWithFrame:CGRectMake(10, 80, kScreenWidth-20-20, 77)];
        [self addSubview:_imgPicker];
        _imgPicker.type = LLImageTypePhoto;
        _imgPicker.maxImageSelected = 5;
        _imgPicker.allowMultipleSelection = NO;
        //    pickerV.showDelete = NO;
        _imgPicker.allowPickingVideo = YES;
        
    }
    return self;
    
}
#pragma mark - textView Delegate
//-(BOOL)textViewShouldBeginEditing:(UITextView *)textView {
//    self.textLab.text = nil;
//    return YES;
//}

-(BOOL)textViewShouldEndEditing:(UITextView *)textView{
    
    [textView resignFirstResponder];
    [textView endEditing:YES];
    return YES;
}
//正在改变
- (void)textViewDidChange:(UITextView *)textView{
    self.textLab.hidden = YES;
    if (textView.text.length == 0) {
        self.textLab.hidden = NO;
    }
}
@end
